package com.lilixia.util;

import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;

public class Util {
	static {
		InputStream is = null;
		OutputStream os = null;
		try {
			String path = System.getProperty("java.io.tmpdir") + "Util.so.tmp";
			is = Util.class.getResourceAsStream("/native/Util.so");
			os = new FileOutputStream(path);
			byte[] bs = new byte[1024];
			int len = 0;
			while ((len = is.read(bs)) != -1) {
				os.write(bs, 0, len);
				os.flush();
			}
			os.close();
			is.close();
			System.load(path);
		} catch (IOException e) {
			e.printStackTrace();
		}
	}

	public native static String getMD5();

	// public native static String getMD5(String string);

	// public native static String getFileMD5(File file);
}
